package com.cycrix.sensor;

import java.util.List;

import android.app.Activity;
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.widget.TextView;

public class RotationVectorActivity extends Activity {
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.accelerometer_screen);
        
        SensorManager mSensorManager;
        List<Sensor> mSensorList;
        
        mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
        mSensorList = mSensorManager.getSensorList(Sensor.TYPE_ROTATION_VECTOR);
        
        StringBuilder buildler = new StringBuilder();
        for (Sensor sensor : mSensorList) {
        	buildler.append("Name: ").append(sensor.getName()).append("\n");
        	buildler.append("Vendor: ").append(sensor.getVendor()).append("\n");
        	buildler.append("Version: ").append(sensor.getVersion()).append("\n");
        	buildler.append("Power: ").append(sensor.getPower()).append(" mA\n");
        	buildler.append("MinDelay: ").append(sensor.getMinDelay()).append(" us\n");
        	buildler.append("Resolution: ").append(sensor.getResolution()).append("\n");
        	buildler.append("MaxRange: ").append(sensor.getMaximumRange()).append("\n");
        	buildler.append("\n");
        }
        
        ((TextView) findViewById(R.id.txtType)).setText(buildler.toString());
    }
}
